package com.lagou.demo.controller;

import com.lagou.demo.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    OrderService orderService;

    /**
     * 用户下单接口（==>发送一条等待付款的消息）
     */
    @RequestMapping("/placeOrder")
    public String placeOrder(){
        return orderService.placeOrder();
    }


    /**
     * 用户付款
     */
    @GetMapping("/paidOrder/{orderId}")
    public String paidOrder(@PathVariable("orderId") String orderId){
        return orderService.paidOrder(orderId);
    }



}
